import React from "react"
import { Navigate } from "react-router-dom"

// 懒加载允许将组件的加载推迟到实际需要渲染时才进行，而不是在应用程序初始加载时就加载所有组件(异步加载)
const Home = React.lazy(() => import("@/views/home"))
const Entire = React.lazy(() => import("@/views/entire"))
const Detail = React.lazy(() => import("@/views/detail"))

const routes = [
  {
    path: "/",
    element: <Navigate to="/home" />
  },
  {
    path: "/home",
    element: <Home />
  },
  {
    path: "/entire",
    element: <Entire />
  },
  {
    path: "/detail",
    element: <Detail />
  }
]

export default routes
